Isolating objects under level 1

Hello Gurus,
I'm trying to isolate a section of my DOORS module for all objects under a given level 1 heading. I have something like the following:

outlining on
level 1
string extractedTitle = "AJ-X-XX-XX"
for o1 in modUpdate do {
if (extractedTitle == o1."Object Heading" ""){
println("\nFound extractedTitle -> " o1."Object Heading" "")

Object o2
Object po = o1
for o2 in po do {
print (o2."Object Heading") " is a child of "
print (po."Object Heading") "\n"
}

}
}

However, this only prints the object immediately after the extracted title whereas I want all the levels that are under the extractedTitle. Any ideas using the current object o1 once I have determined that AJ-X-XX-XX is found?

Thanks !
Pat
PatrickGuay - Wed Oct 19 11:12:23 EDT 2011

Re: Isolating objects under level 1
adevicq - Wed Oct 19 13:00:16 EDT 2011

Hi,

Each time I have to do that I write a recursive function to loop through the children of an object.
 

void dealWith(Object o) {
 
}

Re: Isolating objects under level 1
adevicq - Wed Oct 19 13:01:29 EDT 2011

Hi,

Each time I have to do that I write a recursive function to loop through the children of an object.
 

void dealWith(Object oBase) {
 
 // whatever needs to be done..
}
 
 
Object oBase = ??? // the base object
 
for

Re: Isolating objects under level 1
adevicq - Wed Oct 19 13:03:55 EDT 2011

Hi,

Each time I have to do that I write a recursive function to loop through the children of an object.
 

void dealWith(Object oParent) {
  Object oChild
  for oChild in oParent {
 //
 // whatever needs to be done...
 //
      dealWith(oChild)
  }
}
 
 
Object oBase = ??? // the base object
 
dealWith(oBase)

 


regards

Alain

 

Re: Isolating objects under level 1
PatrickGuay - Wed Oct 19 13:21:04 EDT 2011

adevicq - Wed Oct 19 13:03:55 EDT 2011

Hi,

Each time I have to do that I write a recursive function to loop through the children of an object.
 

void dealWith(Object oParent) {
  Object oChild
  for oChild in oParent {
 //
 // whatever needs to be done...
 //
      dealWith(oChild)
  }
}
 
 
Object oBase = ??? // the base object
 
dealWith(oBase)

 


regards

Alain

 

This does the trick as far as identifying all descendants of the determined base object. Thanks for your snippet